import random

tuple1=random.getstate()#记录生成器的状态
for i in range(20):
    print(random.randint(0,10),end=' ')
print()
random.setstate(tuple1)#传入参数回复之间的状态
for i in range(20):
    print(random.randint(0,10),end=' ')#两次输出的结果一致

